import java.util.HashMap;
import java.util.Map;

/**
 * Created by 86135 on 2020/2/19.
 */
public class Test03 {
    public static void main(String[] args) {


        int[] arr = {22,19,12,38,56,76,43,12,34,54,23,54,22,12,53};
        Map<Integer, Integer> map = getmap(arr);
        for (Integer key : map.keySet()) {
            System.out.println("最小值的索引值为："+key+"值为"+map.get(key));
        }

    }
    public static Map<Integer,Integer> getmap(int[] arr){
        Map<Integer,Integer> map = new HashMap<>();
        int min = arr[0];
        for (int i = 0; i < arr.length; i++) {
            if (min > arr[i]){
                min = arr[i];
            }
        }
        for (int i = 0; i < arr.length; i++) {
            if (min ==  arr[i]){
                map.put(i,arr[i]);
            }
        }
        return map;
    }
}
